package com.panopset.db;

import java.io.StringWriter;


/**
 * Database connection definition.
 * @author Karl Dinwiddie
 *
 */
public abstract class ConnectionDefinition {

    /**
     * @return Driver class, for example <b>com.mysql.jdbc.Driver</b>.
     */
    public abstract String getDriver();

    /**
     * @return Database URL, for example <b>jdbc:mysql://localhost:3306/ics</b>.
     */
    public abstract String getUrl();

    /**
     * @return Database connection user name.
     */
    public abstract String getUserName();

    /**
     * @return Database connection password.
     */
    public abstract String getPassword();

    @Override
    public final String toString() {
        StringWriter sw = new StringWriter();
        sw.append("Driver: ");
        sw.append(getDriver());
        sw.append("\n");
        sw.append("Url: ");
        sw.append(getUrl());
        return sw.toString();
    }
}
